{% extends "public/base.html" %}
{% load js %}

{% block breadcrumbs %}{{block.super}} / <a href="{% url 'managers' %}">managers</a>{% endblock %}

{% block head_resources %}
  {{block.super}}
  {% jsinclude "tables" %}
{% endblock %}

{% block head %}
{{block.super}}
<script type="text/javascript">
$(function() {
    $("#amtable").tablesorter({
        textExtraction: function(node) {
            val = node.getAttribute("val");
            if (val == null)
                val = node.textContent || node.innerText;
            return val;
        },
    })
});
</script>
{% endblock %}


{% block content %}

<div id="intro">
    This is a list of all Application Managers. Click on a header to sort the
    table. Shift-click to sort by more than one element.
</div>

<h1>Debian New Member - Application Manager List</h2>

<table id="amtable" class="tablesorter">
    <thead>
        <tr>
            <th>Since</th>
            <th>Uid</th>
            <th>Name</th>
            {% if visitor.is_am %}
            <th>Cur</th>
            <th>Max</th>
            <th>Hold</th>
            <th>Done</th>
            {% endif %}
            <th>Active</th>
            <th>Ctte</th>
            <th>FD</th>
            <th>DAM</th>
        </tr>
    </thead>
    <tbody>
        {% for am in ams %}
        <tr>
            <td>{{am.created|date:"Y-m-d"}}</td>
            <td>{{am.person.uid}}</td>
            <td><a href="{{ am.person.get_absolute_url }}">{{am.person.fullname}}</a></td>
            {% if visitor.is_am %}
            <td>{{am.stats_active}}</td>
            <td>{{am.slots}}</td>
            <td>{{am.stats_held}}</td>
            <td>{{am.stats_done}}</td>
            {% endif %}
            <td val="{{am.is_am|yesno:"1,0"}}">{{am.is_am|yesno:"yes,-"}}</td>
            <td val="{{am.is_am_ctte|yesno:"1,0"}}">{{am.is_am_ctte|yesno:"ctte,-"}}</td>
            <td val="{{am.is_fd|yesno:"1,0"}}">{{am.is_fd|yesno:"fd,-"}}</td>
            <td val="{{am.is_dam|yesno:"1,0"}}">{{am.is_dam|yesno:"dam,-"}}</td>
            </td>
        </tr>
        {% endfor %}
    </tbody>
</table>

{% endblock %}

